package cn.usian.service.impl;

import cn.usian.dao.EmpDao;
import cn.usian.pojo.Emp;
import cn.usian.service.EmpService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpDao empDao;

    @Override
    public void del(Integer eid) {
        empDao.del(eid);
    }

    @Override
    public Page<Emp> findAll(Page<Emp> empPage, LambdaQueryWrapper<Emp> queryWrapper) {
        return empDao.selectPage(empPage,queryWrapper);
    }

    @Override
    public Emp findByEid(Integer eid) {
        return empDao.selectById(eid);
    }

    @Override
    public void update(Emp emp) {
        empDao.updateById(emp);
    }

    @Override
    public void add(Emp emp) {
        empDao.insert(emp);
    }


}
